/*
采用指针数组，动态分配
*/
#include <iostream>
using namespace std;
struct student{
    char no[6];
    char name[11];
    int score1;
    int score2;
    int score3;
    int sum;
};

int main()
{
    int N;
    student * pStudents[10]={NULL};
    cin>>N;
    for(int i = 0; i<N; i++)
    {
        student * p =new student;
        cin>>p->no>>p->name>>p->score1>>p->score2>>p->score3;
        p->sum = p->score1 + p->score2 + p->score3;

        pStudents[i] = p;
    }
    student * pMax = pStudents[0];
    for(int i = 0; i<N; i++ )
    {
        if(pStudents[i]->sum > pMax->sum)
            pMax = pStudents[i];
    }
     cout<<pMax->name <<" "<<pMax->no << " " <<pMax->sum;

    for(int i = 0; i<N; i++)
        delete pStudents[i];
}